<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  var d = new Date();
  // 获取完整日期对象
  console.log(d);
  console.log(typeof d);

  // 获取完整日期字符
  console.log( d.toString() );
  console.log( typeof d.toString() );
  
  // 获取本地完整日期格式字符
  console.log( d.toLocaleString() );
  
  // 获取年月日字符
  console.log( d.toDateString() );
  // 获取本地年月日字符
  console.log( d.toLocaleDateString() );
  
  // 获取时分秒字符
  console.log( d.toTimeString() );
  // 获取本地时分秒字符
  console.log( d.toLocaleTimeString() );

  // 获取时间戳
  console.log( d.valueOf() );
  console.log( Date.now() );
  
</script>
</html>